package su.msk.jet.team01.chatik.client.ui.swing;

import javax.swing.JFrame;

import su.msk.jet.team01.chatik.client.ui.UserInterface;

@SuppressWarnings("serial")
public class ChatForm extends JFrame implements UserInterface {

	private static final String FORM_TITLE = "Chatik";

	private final ChatPanel panel;

	public ChatForm() {
		super(FORM_TITLE);

		panel = new ChatPanel();
		add(panel);

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		pack();
		setLocationRelativeTo(null);
		setVisible(true);

		panel.focus();
	}

	@Override
	public void printMessage(final String message) {
		panel.printMessage(message);
	}

	@Override
	public String readMessage() {
		return panel.readMessage();
	}

}
